import axios from '../utils/request'

export const getchanne = () =>
  axios({

    url: '/v1_0/channels'

  })
// 添加用户频道
export const addUserChannel = (channel) => axios({

  method: 'PATCH',
  url: '/v1_0/user/channels',
  data: {
    channels: [channel] // 这个参数必须是数组格式，但其实只需要传递一个对象过来即可
  }

})

// 删除频道
export const deleteUserChannel = (channelId) => axios({

  method: 'DELETE',
  url: `v1_0/user/channels/${channelId}`
})
